package com.xplay.xpocker.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xplay.xpocker.config.MsMetaTypeHandler;
import com.xplay.xpocker.room.mahjong.dto.MahjongMessage;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author xplay
 * @since 2023-08-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "game_ru_mahjong_user", autoResultMap = true)
public class GameRuMahjongUser implements Serializable {

    @TableId
    private BigDecimal id;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private BigDecimal userId;

    /**
     * 胡的谁
     */
    @TableField(value = "win_user", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal winUser;
    /**
     * 是否为庄家
     */
    private Boolean banker;
    /**
     * 是否胡牌
     */
    @TableField(value = "win", updateStrategy = FieldStrategy.IGNORED)
    private boolean win;

    @TableField(value = "listen", updateStrategy = FieldStrategy.IGNORED)
    private boolean listen;


    /**
     * 手牌是什么
     */
    @TableField(value = "hand_cards", updateStrategy = FieldStrategy.IGNORED)
    private String handCards;
    /**
     * 听牌是什么
     */
    @TableField(value = "listen_cards", updateStrategy = FieldStrategy.IGNORED)
    private String listenCards;

    @TableField(value = "export_cards", updateStrategy = FieldStrategy.IGNORED)
    private String exportCards;
    /**
     * 胡牌那一张
     */
    @TableField(value = "win_card", updateStrategy = FieldStrategy.IGNORED)
    private Integer winCard;

    private Integer score;

    @TableField(value = "win_number")
    private int winNumber;
    /**
     * 待处理任务
     */
    @TableField(value = "wait_completed", updateStrategy = FieldStrategy.IGNORED)
    private String waitCompleted;

    /**
     * 待处理任务
     */
    @TableField(value = "completed_history", updateStrategy = FieldStrategy.IGNORED)
    private String completedHistory;
    /**
     * 上一次的 已处理任务
     */
    @TableField(value = "before_completed", updateStrategy = FieldStrategy.IGNORED)
    private String beforeCompleted;
    /**
     * 用户要处理任务的任务     还没处理
     */
    @TableField(value = "completed", updateStrategy = FieldStrategy.IGNORED)
    private String completed;
    @TableField("room_id")
    private BigDecimal roomId;
    @TableField(value = "touch_card", updateStrategy = FieldStrategy.IGNORED)
    private Integer touchCard;


    /**
     * 这个字段
     * 是用户处理的报文
     * 这个字段一般来说是不会存储数据的
     * 变成待处理
     */
    @TableField(value = "completed_data", updateStrategy = FieldStrategy.IGNORED, typeHandler = MsMetaTypeHandler.class)
    private MahjongMessage completedData;

    @TableField(value = "swap_card_out", updateStrategy = FieldStrategy.IGNORED)
    private String swapCardOut;
    @TableField(value = "swap_card_in", updateStrategy = FieldStrategy.IGNORED)
    private String swapCardIn;
    @TableField(value = "swap_user_id", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal swapUserId;

}
